#ifndef PORTMAPPINGTHREAD_H
#define PORTMAPPINGTHREAD_H

#include <QThread>
#include "Network.h"
#include "miniupnpc/upnpcommands.h"
#include "miniupnpc/miniupnpc.h"

class PortMappingThread : public QThread {

    Q_OBJECT

    typedef enum PortOperation {
        NONE = -1,
        CHECKING,
        FORWARDING,
        DELETING
    } PortOperation;

public:
    explicit PortMappingThread(QObject *parent = 0);
    void setLocalIP(QString localIP);
    void checkPort();
    void forwardPort();
    void deletePort();

signals:
    void portStatusChanged(int status);

private:
    void run();

    QString localIPString;
    PortOperation currentOperation;

};

#endif // PORTMAPPINGTHREAD_H
